package com.integrationpath.mengine.model;

// Generated 06-Jan-2010 12:35:49 by Hibernate Tools 3.2.5.Beta

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * LinkCategory generated by hbm2java
 */
@Entity
@Table(name = "link_category")
public class LinkCategory implements java.io.Serializable {

	private Integer id;
	private LinkType linkType;
	private String name;
	private Set<Link> links = new HashSet<Link>(0);

	public LinkCategory() {
	}

	public LinkCategory(LinkType linkType, String name, Set<Link> links) {
		this.linkType = linkType;
		this.name = name;
		this.links = links;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "type_id")
	public LinkType getLinkType() {
		return this.linkType;
	}

	public void setLinkType(LinkType linkType) {
		this.linkType = linkType;
	}

	@Column(name = "name", length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "linkCategory")
	public Set<Link> getLinks() {
		return this.links;
	}

	public void setLinks(Set<Link> links) {
		this.links = links;
	}

}
